﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace Studio
{
	// Token: 0x020004D3 RID: 1235
	public class LightList : MonoBehaviour
	{
		// Token: 0x06001F71 RID: 8049 RVA: 0x000C3808 File Offset: 0x000C1A08
		public void OnClick(int _no)
		{
			Singleton<Studio>.Instance.AddLight(_no);
		}

		// Token: 0x06001F72 RID: 8050 RVA: 0x000C3818 File Offset: 0x000C1A18
		private void AddNode(int _key, string _name)
		{
			GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.objectNode);
			gameObject.transform.SetParent(this.transformRoot, false);
			if (!gameObject.activeSelf)
			{
				gameObject.SetActive(true);
			}
			GameSceneNode component = gameObject.GetComponent<GameSceneNode>();
			int key = _key;
			component.AddActionToButton(delegate
			{
				this.OnClick(key);
			});
			component.text = _name;
		}

		// Token: 0x06001F73 RID: 8051 RVA: 0x000C388C File Offset: 0x000C1A8C
		private void Awake()
		{
			foreach (KeyValuePair<int, Info.LightLoadInfo> keyValuePair in Singleton<Info>.Instance.dicLightLoadInfo)
			{
				this.AddNode(keyValuePair.Key, keyValuePair.Value.name);
			}
		}

		// Token: 0x0400212A RID: 8490
		[SerializeField]
		private GameObject objectNode;

		// Token: 0x0400212B RID: 8491
		[SerializeField]
		private Transform transformRoot;
	}
}
